Method to find integrating factor